% TEST_ID: LANG-ASSIGN-0006
% CATEGORY: language/assign
% 嵌套函数内的赋值

function test_assign_scope()

    x = g() + 2i;
    x = x + 2i;

    assert(x == (4i + 11))

    function x = g
        x = 0;
        for i = 1:10
            x = i + 1;
        end
    end

end